---@class Table_MissionItem
local Table_MissionItem = BaseClass("Table_MissionItem", IDataItem)

function Table_MissionItem:__ctor()
	---@type number @唯一ID
	self.Id = 0
	---@type string @任务标题
	self.Title = ""
	---@type string @任务描述
	self.Desc = ""
	---@type string @任务图标
	self.Icon = ""
	---@type string @图标图集
	self.Atlas = ""
	---@type number @任务类型
	self.TaskType = 0
	---@type number @功能点类型
	self.FuncType = 0
	---@type number @功能点数量
	self.FuncNum = 0
	---@type number @后置任务id
	self.NextId = 0
	---@type number[] @跳转界面id
	self.UId = {}
	---@type number @优先级
	self.SortId = 0
	---@type number @奖励类型
	self.AwardType = 0
	---@type number[] @奖励
	self.Award = {}
	---@type number @客户端显示类型
	self.ShowType = 0
	---@type number @完成后处理
	self.Finish = 0
end

function Table_MissionItem:Load(reader)
	self.temp = reader:ReadShortString()
	self.Id = tonumber(self.temp)
	self.Title = reader:ReadString()
	self.Desc = reader:ReadString()
	self.Icon = reader:ReadString()
	self.Atlas = reader:ReadString()
	self.temp = reader:ReadShortString()
	self.TaskType = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.FuncType = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.FuncNum = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.NextId = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.UId = Utility.StringToNumbers(self.temp)
	self.temp = reader:ReadShortString()
	self.SortId = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.AwardType = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.Award = Utility.StringToNumbers(self.temp)
	self.temp = reader:ReadShortString()
	self.ShowType = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.Finish = tonumber(self.temp)
end

---@class Table_MissionMgr : IDataMgr
local this = BaseClass("Table_MissionMgr", IDataMgr)

function this:FileName()
	return "Txt/Mission.txt"
end

---@return Table_MissionItem
function this:GetItemByKey(key)
	return self.super.GetItemByKey(self, key)
end

---@return Table_MissionItem
function this:GetItemByIdx(idx)
	return self.super.GetItemByIdx(self, idx)
end

function this:Load(reader)
	local item = Table_MissionItem()
	item:Load(reader)
	self.mItemDic[item.Id] = self.mDataCount
	table.insert(self.mItemList, item)
end

---@type Table_MissionMgr
Table_MissionMgr = this()